home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 27.zip
/
BS1 part 27
/
ImageMaster_d3.adf
/
piarc.lzh.parta
/
iraw.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-04-14
|
3KB
|
132 lines
/*
* IRAW.rexx - I-raw is a 'chunky' graphics format used on
* DEC VAX platforms, and as an interchange image format
* between VAX graphics and Intel based machines.
*
* Written by: Barry Chalmers
* Last Update: March 25th, 1993
* Revision: 1.02
* For: Black Belt Systems image processing series IM, IM F/c, and IP.
* ---------------------------------------------------------------------------
* Revision: 1.01 - see ReadMe file for details on changes to this level
*
* 1.02 25 Mar 1993 (BC) Did not report on insufficient memory for
* new buffer from IM prior to 9.51
*/
parse arg var1
call pragma('stack',20000);
/*
* open rexxsupport.library -- needed for some functions
*/
if ~show('L',"rexxsupport.library") then do
if addlib('rexxsupport.library',0,-30,0) then do
/* everything's ok */
end;
else do
say 'We Have A Library Problem, Unable To Load "rexxsupport.library"';
say 'Cannot operate without this library - sorry!';
exit 10;
end;
end;
/*
* This code attempts to read a file called "picmdpath" from REXX:
* If it can't find it, the script will assume that the commands
* associated with this PI Module are in "c:". If the file exists,
* the script will look in the path that is specified in the file.
* If you create this file, you MUST put a complete, correct path
* in it; if the commands are in a sub-directory, you have to put
* the trailing slash on the path (like, device:dir/).
*
*/
cmdpath = 'c:';
if open(fhandle,'rexx:picmdpath','read') then /* open the file */
do
cmdpath = readln(fhandle);
call close(fhandle); /* close the file */
end
prtnme = 'IM_Port';
address(prtnme);
if var1 = 'load' then do
pick = 1;
end
else if var1 = 'save' then do
pick = 2;
end
else do
options results;
'gadgets "Load","I-raw","Save","I-raw"';
pick = result;
options;
end;
if pick=0 then do
exit 0;
end;
path = 'ram:';
name = '';
ext = '';
if pick = 1 then do
options results;
'filerequest "'||path||'","'||name||'","'||ext||'","Load I-raw"';
irawfile = result;
options;
if irawfile = 'FR_CANCELLED' then do
address(prtnme);
'imtofront';
exit 0;
end;
address(prtnme);
options results;
'jackin';
jackadr = result;
options;
address(prtnme);
options results;
'jackin';
jackadr = result;
options;
address command cmdpath||'iraw '||jackadr||' 0 '||irawfile;
address(prtnme);
'redraw'
exit 0;
end;
if pick = 2 then do
options results;
'filerequest "'||path||'","'||name||'","'||ext||'","Save I-raw"';
irawfile = result;
options;
if irawfile = 'FR_CANCELLED' then do
address(prtnme);
'imtofront';
exit 0;
end;
address(prtnme);
options results;
'jackin';
jackadr = result;
options;
address command cmdpath||'iraw '||jackadr||' 1 '||irawfile;
exit 0;
end;
exit 0;
end;
/* The end */